package com.lemon.controller;
import com.lemon.domain.PageResult;
import com.lemon.domain.Result;
import com.lemon.domain.WarehousingEntryDetailsSort;
import com.lemon.service.WarehousingEntryDetailsSortService;
import com.lemon.service.impl.WarehousingEntryDetailsSortServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDateTime;

/**
* 入库明细分拣表(warehousing_entry_details_sort)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/warehousing_entry_details_sort")
@RequiredArgsConstructor
public class WarehousingEntryDetailsSortController {
/**
* 服务对象
*/
    private final WarehousingEntryDetailsSortService warehousingEntryDetailsSortService;

    @GetMapping("/{warehousingEntryDetailsId}")
    public Result getCountByWarehousingEntryDetailsId(@PathVariable Long warehousingEntryDetailsId) {
        Integer countAble =  warehousingEntryDetailsSortService.getCount(warehousingEntryDetailsId);
        return Result.success(countAble);
    }

    @PostMapping
    public Result add(Integer id,Integer count,Integer damageCount){
        warehousingEntryDetailsSortService.add(id,count,damageCount);
        return Result.success();
    }


}
